f = open('entity.lst', 'r');
o = open('entity_unique.lst', 'a')
last_word = ''
count = 0
for line in f:
    if line != '\n' and line != last_word:
        last_word = line
        count += 1
        o.write(line)
o.close()
f.close()